package javacode.ch06;

import javacode.ch06.Magician;
import javacode.ch06.Role;
import javacode.ch06.SwordsMan;

/**
 * Created by lenovo on 2016/3/27.
 */
public class RPG2 {
    public static void main(String[] args){
        SwordsMan swordsMan=new SwordsMan();
        swordsMan.setName("Justin");
        swordsMan.setLevel(1);
        swordsMan.setBlood(200);

        Magician magician =new Magician() ;
        magician .setName("Monica");
        magician .setLevel(1);
        magician .setBlood(100);

        showBlood(swordsMan);
        showBlood(magician );
    }
    static void showBlood(Role role ){
        System.out.printf("%s血量%d%n",role.getName(),role.getBlood());
    }
}
